-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Optimize solari initial and temporal DI #20156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Please add this PR (and yourself!) to the draft release notes :) |
Lets hold off on this until #20213 is merged. |
@SparkyPotato the linked PR is merged; could you resolve conflicts and merge main in please? |
I'm getting instant NaNs with this PR :( |
if reservoir_valid(reservoir) { | ||
let inverse_target_function = select(0.0, 1.0 / reservoir_target_function, reservoir_target_function > 0.0); | ||
reservoir.unbiased_contribution_weight = weight_sum * inverse_target_function; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add back the newline please
return empty_reservoir(); | ||
} | ||
temporal_reservoir.sample.light_id = (light_id << 16u) | triangle_id; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool. Surprised how big a win this is.
@SparkyPotato ready to merge once conflicts are resolved :) |
# Objective Optimizes the initial + temporal ReSTIR DI pass. In the example cornell box scene, it goes from 2.37 ms to 1.97 ms. On a more complex scene, the Lumberyard bistro, with many emissive lights, it goes from 130+ ms to about 80.8 ms at 1440p on a 4070. I also noticed that triangle area calculation didn't take object scale into account and fixed that. ## Solution - Switch to textures instead of buffers for reservoir storage. - There's also a bunch of other micro-optimizations to increase SM occupancy and reduce memory pressure. ## Testing - This was tested on the cornell box example scene and bistro. - Everything was tested on Windows 11 with a 4070 running at 1440p. Testing on other platforms and GPUs by running the example. --- ## Showcase <img width="2560" height="1392" alt="image" src="https://github.com/user-attachments/assets/b53f66e8-c97d-4f94-b30f-bbe6ade1a507" />
Objective
Optimizes the initial + temporal ReSTIR DI pass. In the example cornell box scene, it goes from 2.37 ms to 1.97 ms. On a more complex scene, the Lumberyard bistro, with many emissive lights, it goes from 130+ ms to about 80.8 ms at 1440p on a 4070.
I also noticed that triangle area calculation didn't take object scale into account and fixed that.
Solution
Testing
Showcase